package org.kukker.view;

import java.util.Map;

import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;

public class KukkerViewContainer extends View{
	String debugtag = "eventflow1"; 
		 
	boolean mDisableKeyEventToChild = true;
	
	public KukkerViewContainer(Context context, AttributeSet attrs,	Map inflateParams) {		
		super(context, attrs, inflateParams);
	}
		
	public boolean onTouchEvent(MotionEvent event){
		super.onTouchEvent(event);
		String actionName = org.kukker.Util.kMotionEvent.getActionName(event);
		 Log.i(debugtag,
	    			"["+this.getClass().getSimpleName()+"]" +
	    			
	    			"["+
	    			"isSelected:"+this.isSelected()+
	    			"]"
	    			
	    			+"["
	    			+"onTouchEvent()"
	    			
	    			+", action:"+actionName
	    			+"]"	    			
			 );
		return false;
	}
	
	
	public boolean onKeyUp(int keyCode, KeyEvent event){
		super.onKeyUp(keyCode, event);
			Log.i(debugtag,
    			"["+this.getClass().getSimpleName()+"]" +
    			
    			"["+
    			"isSelected:"+this.isSelected()+
    			"]"
    			
    			+"["
    			+"onKeyUp() " +
    			",keyCode:"+keyCode
    			
    			+"]"    			
    	);
		
		return false;
	}
	
	public boolean onKeyDown(int keyCode, KeyEvent event){
		super.onKeyDown(keyCode, event);
		Log.i(debugtag,
    			"["+this.getClass().getSimpleName()+"]" +
    			
    			"["+
    			"isSelected:"+this.isSelected()+
    			"]"
    			
    			+"["
    			+"onKeyDown() " +
    			",keyCode:"+keyCode
    			
    			+"]"    			
    	);
		return false;
	}
	
 	 public void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect){
  	Log.i(debugtag,

		"[" + this.getClass().getSimpleName() + "]" +

		"[" + "isSelected:" + this.isSelected() + "]"

		+ "[" + "onFocusChanged()" + ", gainFocus:" + gainFocus
				+ ", direction:" + direction + "]"

		);
		  	if(gainFocus){
		  		
		  	}else{
		  		
		  		
		  	}
		
	}
		
	
	
	
}